import 'package:storage/generated/json/base/json_convert_content.dart';
import 'package:storage/model/bind_good_and_company_model_entity.dart';

BindGoodAndCompanyModelEntity $BindGoodAndCompanyModelEntityFromJson(
    Map<String, dynamic> json) {
  final BindGoodAndCompanyModelEntity bindGoodAndCompanyModelEntity = BindGoodAndCompanyModelEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    bindGoodAndCompanyModelEntity.id = id;
  }
  final int? companyId = jsonConvert.convert<int>(json['companyId']);
  if (companyId != null) {
    bindGoodAndCompanyModelEntity.companyId = companyId;
  }
  final int? goodsId = jsonConvert.convert<int>(json['goodsId']);
  if (goodsId != null) {
    bindGoodAndCompanyModelEntity.goodsId = goodsId;
  }
  final double? goodsPrice = jsonConvert.convert<double>(json['goodsPrice']);
  if (goodsPrice != null) {
    bindGoodAndCompanyModelEntity.goodsPrice = goodsPrice;
  }
  final double? companyPrice = jsonConvert.convert<double>(
      json['companyPrice']);
  if (companyPrice != null) {
    bindGoodAndCompanyModelEntity.companyPrice = companyPrice;
  }
  final String? companyName = jsonConvert.convert<String>(json['companyName']);
  if (companyName != null) {
    bindGoodAndCompanyModelEntity.companyName = companyName;
  }
  final String? goodsName = jsonConvert.convert<String>(json['goodsName']);
  if (goodsName != null) {
    bindGoodAndCompanyModelEntity.goodsName = goodsName;
  }
  final String? goodsSpecification = jsonConvert.convert<String>(
      json['goodsSpecification']);
  if (goodsSpecification != null) {
    bindGoodAndCompanyModelEntity.goodsSpecification = goodsSpecification;
  }
  return bindGoodAndCompanyModelEntity;
}

Map<String, dynamic> $BindGoodAndCompanyModelEntityToJson(
    BindGoodAndCompanyModelEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['companyId'] = entity.companyId;
  data['goodsId'] = entity.goodsId;
  data['goodsPrice'] = entity.goodsPrice;
  data['companyPrice'] = entity.companyPrice;
  data['companyName'] = entity.companyName;
  data['goodsName'] = entity.goodsName;
  data['goodsSpecification'] = entity.goodsSpecification;
  return data;
}

extension BindGoodAndCompanyModelEntityExtension on BindGoodAndCompanyModelEntity {
  BindGoodAndCompanyModelEntity copyWith({
    int? id,
    int? companyId,
    int? goodsId,
    double? goodsPrice,
    double? companyPrice,
    String? companyName,
    String? goodsName,
    String? goodsSpecification,
  }) {
    return BindGoodAndCompanyModelEntity()
      ..id = id ?? this.id
      ..companyId = companyId ?? this.companyId
      ..goodsId = goodsId ?? this.goodsId
      ..goodsPrice = goodsPrice ?? this.goodsPrice
      ..companyPrice = companyPrice ?? this.companyPrice
      ..companyName = companyName ?? this.companyName
      ..goodsName = goodsName ?? this.goodsName
      ..goodsSpecification = goodsSpecification ?? this.goodsSpecification;
  }
}